package com.school.springboot_login.dao;


import com.school.springboot_login.bean.RegisterLog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import java.util.Date;

@Repository
public class RegisterLogDao {
    @Autowired
    private JdbcTemplate jdbcTemplate;
    public void insertRegisterLog(String name) {
        String sqlStr = "INSERT INTO registerlog(user_name,ip,register_datetime) "
                + "VALUES(?,?,?)";
        Object[] args = {name, "192.168.0.1",
                new Date()};
        jdbcTemplate.update(sqlStr, args);
    }
}
